var moment = require('moment');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var Common = require('../util/common');

var Genset = new Schema({
  author: {
    type: Schema.Types.ObjectId,
    ref: "User"
  },
  name: {
    type: String,
    default: ''
  },
  discription: {
	  type: String,
	  default: ''
  },
  logo: {
	  type: String,
	  default: ''
  },
  coverplan: {
	  type: String,
	  default: ''
  },
  lastmod: {
    type: Date,
    default: moment().utc().format()
  }
});

Genset.pre("save", function(next) {
  this.lastmod = moment().utc().format();
  next();
});

exports.Genset = mongoose.model("Genset", Genset);
